import random
from queue import Queue
import threading
import  time

def put_data(queue):
    while True:
        queue.put(random.randint(10,100))
        time.sleep(0.3)
        print(queue.qsize())

def get_data(queue):
        while True:
            print(f"已经获取到多列当中的--{queue.get()}--元素")

def main():
    queue = Queue(10)
    t1 = threading.Thread(target= put_data,args=(queue,))
    t2 = threading.Thread(target= get_data,args=(queue,))
    t1.start()
    t2.start()

if __name__ == '__main__':
    main()